<?php

/**
 * CodeRS - Atviras kodas Lietuvai
 * Copyright (C) 2007 CodeRS www.coders.lt info@coders.lt
 * MightMedia TVS
 * config.php - administruojame pagrindinius TVS nustatymus
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 * 
 * 
 * Ši programa yra laisva. Jūs galite ją platinti ir/arba modifikuoti
 * remdamiesi Free Software Foundation paskelbtomis GNU Bendrosios
 * Viešosios licencijos sąlygomis: 2 licencijos versija, arba (savo
 * nuožiūra) bet kuria vėlesne versija.
 * 
 * Ši programa platinama su viltimi, kad ji bus naudinga, bet BE JOKIOS
 * GARANTIJOS; be jokios numanomos PERKAMUMO ar TINKAMUMO KONKRETIEMS
 * TIKSLAMS garantijos. Žiūrėkite GNU Bendrąją Viešąją licenciją norėdami
 * sužinoti smulkmenas.
 * 
 * Jūs turėjote kartu su šia programa gauti ir GNU Bendrosios Viešosios
 * licencijos kopija; jei ne - rašykite Free Software Foundation, Inc., 59
 * Temple Place - Suite 330, Boston, MA 02111-1307, USA.
**/

if ($_SERVER['PHP_SELF'] == __FILE__) { header('location: ?'); exit(); }
if (!ADMIN) { perkelti('?'); }
?>
<h2>Svetainės pagrindiniai nustatymai</h2>
<script language="JavaScript">
// Notice: The simple theme does not use all options some of them are limited to the advanced theme
tinyMCE.init({
	mode : "textareas",
	elements : "Apie,Maintenance",
	theme : "simple",
	mode : "exact",
	//content_css : "stilius/stilius.css",
	//apply_source_formatting : true,
});

</script>
<?
if (isset($_POST) && !empty($_POST) && isset($_POST['Konfiguracija'])) {
	$q = "UPDATE `".LENTELES_PRIESAGA."nustatymai` SET
	`Apie` = ".$db->fix($_POST['Apie']).",
	`Keywords` = ".$db->fix($_POST['Keywords']).",
	`Pavadinimas` = ".$db->fix($_POST['Pavadinimas']).",
	`Render` = ".$db->fix($_POST['Render']).",
	`Copyright` = ".$db->fix($_POST['Copyright']).",
	`Pastas` = ".$db->fix($_POST['Pastas']).",
	`Registracija` = ".$db->fix($_POST['Registracija']).",
	`Palaikymas` = ".$db->fix($_POST['Palaikymas']).",
	`Chat_limit` = ".$db->fix($_POST['Chat_limit']).",
	`News_limit` = ".$db->fix($_POST['News_limit']).",
	`Maintenance` = ".$db->fix($_POST['Maintenance'])." LIMIT 1 ;";
	$db->uzklausa($q);
	header('Location: ?id,46;a,1');
}

$nustatymai = array(
	"Form"=>array("action"=>"","method"=>"post","enctype"=>"","id"=>"","class"=>"","name"=>"reg"),
	"Pagrindinis svetaines pavadinimas:"=>array("type"=>"text","value"=>input($conf['Pavadinimas']),"name"=>"Pavadinimas","style"=>"width:400px"),
	"Trumpai apie svetainę:"=>array("type"=>"textarea","value"=>input($conf['Apie']),"name"=>"Apie","class"=>"input","rows"=>"10","style"=>"width:400px"),
	"Raktiniai žodžiai: (skirkite žodžius kableliais)"=>array("type"=>"textarea","value"=>input($conf['Keywords']),"name"=>"Keywords","rows"=>"3","class"=>"input","style"=>"width:400px"),
	"Ar rodyti sugeneravimo laiką:"=>array("type"=>"select","value"=>array("1"=>"Taip","0"=>"Ne"),"selected"=>input($conf['Render']),"name"=>"Render"),
	"Copyright Tekstas:"=>array("type"=>"text","value"=>input($conf['Copyright']),"name"=>"Copyright","style"=>"width:400px"),
	"Svetaines e-paštas:"=>array("type"=>"text","value"=>input($conf['Pastas']),"name"=>"Pastas","style"=>"width:200px"),
	"Leisti registruotis:"=>array("type"=>"select","value"=>array("1"=>"Taip","0"=>"Ne"),"selected"=>input($conf['Registracija']),"name"=>"Registracija"),
	"Svetaine remontuojama?:"=>array("type"=>"select","value"=>array("1"=>"Taip","0"=>"Ne"),"selected"=>input($conf['Palaikymas']),"name"=>"Palaikymas"),
	"Uždarytos svetaines tekstas:"=>array("type"=>"textarea","value"=>input($conf['Maintenance']),"name"=>"Maintenance","rows"=>"10","class"=>"input","style"=>"width:400px"),
	"Kiek rodyti ChatBox pranešimu?"=>array("type"=>"select","value"=>array("5"=>"5","10"=>"10","15"=>"15","20"=>"20","25"=>"25","30"=>"30","35"=>"35","40"=>"40"),"selected"=>input($conf['Chat_limit']),"name"=>"Chat_limit"),
	"Kiek rodyti naujienu?"=>array("type"=>"select","value"=>array("5"=>"5","10"=>"10","15"=>"15","20"=>"20","25"=>"25","30"=>"30","35"=>"35","40"=>"40"),"selected"=>input($conf['News_limit']),"name"=>"News_limit"),
	""=>array("type"=>"submit","name"=>"Konfiguracija","value"=>"Saugoti")
);

include_once(HOME_DIR."variklis/class/forms_inputs.php");
$bla = new forma();
echo $bla->form($nustatymai,"Pagrindiniai nustatymai");
?>